<template>
    <div >
        <div class="zhuanti" v-for="item in data" :key="item.id">
            <img :src="item.scene_pic_url" alt="" width="100%">
            <p>{{item.title}}</p>
            <p>{{item.subtitle}}</p>
            <p style="padding-bottom:.2rem;color:#9b0000">{{item.price_info  | RMBNumber}}</p>
        </div>
        <van-pagination v-model="currentPage"  :page-count='totalPages' mode="simple" @change="change"/>
        <br><br><br>
    </div>
</template>

<script>
    import {GetZhuanTi,} from "@/request/api.js"
export default {
    name: 'WorkspaceJsonTopic',

    data() {
        return {
            data:[],
            totalPages:'',
            currentPage:1
        };
    },

    mounted() {
        
    },

    methods: {
        change(v){
            this.currentPage = v
            
            GetZhuanTi({
                page:v
            })
            .then(res=>{
                this.data = res.data.data
                // console.log(res);
            })


        }
    },
    created(){
        GetZhuanTi({
            page:this.currentPage,
            size:10
        })
        .then(res=>{
            // console.log(res);
            this.data=res.data.data
            this.totalPages = res.data.totalPages
        })
    }
};
</script>

<style lang="less" >
.zhuanti{
    background-color: #fff;
    margin-bottom: .2rem;
    
}
p{
    text-align: center;
    margin: .2rem 0;
}
</style>